/*
 * @Title Person.java
 * @Description
 * 引入jpa支持、provider实现包
 * @Copyright Copyright(c) 2018
 * @Company com.lizhen
 * @author lizhen
 * @version 0.0.1
 */
package com.lizhen.persist;

import com.lizhen.entity.Person;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 * @author lizhen
 */
public class PersonDemo {

    /**
     * @author lizhen
     */
    public PersonDemo() {
    }

    /**
     * @author lizhen
     */
    public static void main(String[] args) {
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("PersonJPA");
        EntityManager em = emf.createEntityManager();
        Person p = em.find(Person.class, "小明");

        System.out.println("Person Name = " + p.getPname());
        System.out.println("Person Age = " + p.getPage());
    }

}
